1. Field of the Invention
The present invention relates to an image reading method using an image scanner, facsimile, etc., the image reading device thereof and the image processing device for processing read images. In particular, the present invention relates to an image reading method for binarizing read image data and the image reading device thereof and the image processing device thereof.
2. Description of the Related Art
Conventionally, if input images are binarized, the peak value of read values is obtained based on a one-line reading of an inputted manuscript, as disclosed in Japanese Patent Laid-open No. 2-142271 (Japanese Patent Application No. 63-296557). Then, a storage circuit for storing the obtained peak value is provided, and the stored peak value is used as a threshold reference value for binarization.
FIGS. 1A and 1B show a conventional threshold value generation, and a level at the prescribed ratio (for example, 50%) to the peak value (Vref) of a read image is used as a threshold value.
The respective peak values of the colors white and black are calculated and the intermediate value (for example, a half) is also used as a threshold value for binarization.
However, both the sensitivity of a sensor for reading images and the lightness of a light source sometimes varies widely and in such a case, the read value of an image fluctuates widely. Therefore, even if the one-line peak value is stored and is used as a reference value for binarization, an error occurs between the obtained peak value and a real peak value since there is a wide fluctuation in input values. For this reason, correct binarization is not performed, which is a problem.
Even if the same value can be obtained in both a white peak value and a black peak value, there is a possibility that the gradation tendency of each image may differ.
Since in the conventional threshold value calculation, a threshold value is uniquely determined based on a peak value, there is a possibility that a binarization process may not be performed well depending on the gradation tendency of an image to be read.
An object of the present invention is to solve such problems and to implement an image reading method for stably binarizing images, and to suggest the image reading device thereof and the image processing device thereof.
The image reading device of the present invention comprises an image reading unit, a threshold value generation unit, a binarization unit and a gradation histogram generation unit.
In the first aspect of the present invention, the image reading unit reads images recorded on a medium. The threshold value generation unit calculates the ratio of appearance frequency between the lowest gradation value and the maximum gradation value from image data read by the image reading unit, and determines a threshold value level based on the calculated ratio. The binarization unit binarizes the read image data based on the determined threshold value level.
In the second aspect of the present invention, the image reading unit reads images recorded on a medium. The threshold value generation unit calculates the ratio of appearance frequency between the lowest gradation value and the highest gradation value from image data read by the image reading unit, and determines a threshold value level based on the calculated ratio. The binarization unit binarizes the read image data based on the determined threshold value level. The gradation histogram generation unit generates the generated gradation histogram distribution of the image data read by the image reading unit. Furthermore, the threshold value generation unit determines the threshold value level based on gradation histogram distribution generated by the gradation histogram generation unit.